<?php
class Session extends Zend_Controller_Plugin_Abstract
{
   public function routeShutdown(Zend_Controller_Request_Abstract $request){

      /*
      $defaultNamespace = new Zend_Session_Namespace();
      
	  
      if (!isset($defaultNamespace->initialized))
      {
         Zend_Session::regenerateId();
         $defaultNamespace->initialized = true;
      }
      
      if(Zend_Auth::getInstance()->hasIdentity()){
	  
		 $ip = Zend_Auth::getInstance()->getStorage()->read()->dane->ip;
		 $agent = Zend_Auth::getInstance()->getStorage()->read()->dane->agent;

	     //chrome frame manipuluje user agentem, nie jest ciagle ten sam, wiec trzeba go wykluczyc ze sprawdzania
         if(($ip != $_SERVER['REMOTE_ADDR'] || $agent != md5($_SERVER['HTTP_USER_AGENT'])) && strpos($_SERVER['HTTP_USER_AGENT'], 'chromeframe') === FALSE){

          
             header("Location: http://" . $_SERVER['SERVER_NAME'] . '/' . Zend_Controller_Front::getInstance()->getBaseUrl());

         }
      }
      
      */
      $zalogowany = Zend_Auth::getInstance()->hasIdentity();
      
      $zgodny = true;
      $aktywny = true;
    
   }
}
